using MicroMsg.Manager;
using MicroMsg.Resource.@string;
using MicroMsg.UI.Page;
using MicroMsg.UI.Util;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class MassSendPluginSetCtrl : PluginSettingBaseCtrl
	{
		internal Grid LayoutRoot;
		internal Button btnStartMassSend;
		internal Button btnClearMsgs;
		private bool _contentLoaded;
		public MassSendPluginSetCtrl()
		{
			this.InitializeComponent();
		}
		public override void Exit()
		{
			base.Exit();
		}
		private void btnStartMassSend_Click(object sender, RoutedEventArgs e)
		{
			ToolFunction.GotoPageForUserControl("/Source/Plugin/MassSend/UI/MessagesListPage.xaml", null, false);
			for (int i = 0; i < PageManager.getInstance().basePageList.get_Count(); i++)
			{
				if (PageManager.getInstance().basePageList.get_Item(i) is MessagesListPage)
				{
					PageManager.getInstance().PopPage();
					return;
				}
			}
		}
		private void btnClearMsgs_Click(object sender, RoutedEventArgs e)
		{
			MMMessageBox mMMessageBox = MMMessageBox.Show(strings.Plugin_ClearPluginMessage, null, true, strings.COM_Confirm, strings.COM_Cancel);
			mMMessageBox.ReturnEvent = new DlgReturnEvent(this.OnClearMassMsgHandler);
		}
		private void OnClearMassMsgHandler(DlgReturnEventArg dlgReturnEventArg_0)
		{
			switch (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0))
			{
			case 0:
				MassMsgMgr.MassMsgClearAll();
				break;
			case 1:
				break;
			default:
				return;
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/MassSend/UI/MassSendPluginSetCtrl.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.btnStartMassSend = (Button)base.FindName("btnStartMassSend");
			this.btnClearMsgs = (Button)base.FindName("btnClearMsgs");
		}
	}
}
